﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FlashPay.Service.Interface
{
    using FlashPay.EF.Models;
    using FlashPay.Entity;
    using FlashPay.Entity.Parameter;
    using FlashPay.Entity.Request.Authorize;
    using FlashPay.Entity.Request.Role;
    using FlashPay.Entity.Response.Company;
    using FlashPay.Entity.Response.Role;

    /// <summary>
    /// 角色业务接口
    /// </summary>
    public interface SysRoleService
    {
        /// <summary>
        /// 根据编号获取角色
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>角色</returns>
        RoleResponse Get(int id);

        /// <summary>
        /// 根据编号获取公司
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>Company</returns>
        RoleResponse GetClone(int companyId, int id);

        /// <summary>
        /// 根据编号获取公司
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>Company</returns>
        List<CompanyResponse> GetCompany(int companyId, int level);

        /// <summary>
        /// 角色保存或修改
        /// </summary>
        /// <returns></returns>
        JResult<SysRole> SaveOrEdit(RoleRequest request, List<AuthorizeRequest> authorizes, List<AuthorizeRequest> unselectedAuthorizes);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <returns></returns>
        JResult UpdateStatus(int id, SByte status);

        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        JResult Delete(int id);

        /// <summary>
        /// 根据条件获取所有角色记录
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<SysRole></returns>
        List<SysRole> GetList(SysRoleQuery query);

        /// <summary>
        /// 获取公司角色编号
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<UserInfo></returns>
        List<SysRole> GetRoleByCompanyId(SysRoleQuery query);

        /// <summary>
        /// 获取角色菜单权限树
        /// </summary>
        /// <param name="userPermission">当前用户功能</param>
        /// <param name="roleSysNo">角色编号</param>
        /// <returns>角色菜单权限树列表</returns>
        List<ZCheckTreeNodeResponse> GetMenuPermissionViewListByRoleSysNo(List<String> userPermission,int mType,int roleSysNo,int userId);

        /// <summary>
        /// 获取角色菜单权限树
        /// </summary>
        /// <param name="roleSysNo">角色编号</param>
        /// <returns>角色菜单权限树列表</returns>
        List<ZCheckTreeNodeResponse> GetMenuPermissionViewListByRole(List<String> userPermission, int mType,int userID);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>PagedList<UserInfo></returns>
        PagedList<RoleResponse> GetPager(SysRoleQuery query);
    }
}
